<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fnx" uri="http://java.sun.com/jsp/jstl/functionsx" %>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="f" uri="http://www.sctv.com/tags/form" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<!DOCTYPE html>
<html>
<head>
    <jsp:include page="/WEB-INF/views/head.jsp"/>
    <script type="text/javascript">
        $(function () {

            $("#sortHead").headSort();
        });

        function confirmDelete() {
            return confirm("<s:message code='confirmDelete'/>");
        }

        function optSingle(opt) {
            if (Cms.checkeds("ids") == 0) {
                alert("<s:message code='pleaseSelectRecord'/>");
                return false;
            }
            if (Cms.checkeds("ids") > 1) {
                alert("<s:message code='pleaseSelectOne'/>");
                return false;
            }
            var id = $("input[name='ids']:checkbox:checked").val();
            location.href = $(opt + id).attr("href");
        }

        function optMulti(form, action, msg) {
            if (Cms.checkeds("ids") == 0) {
                alert("<s:message code='pleaseSelectRecord'/>");
                return false;
            }
            if (msg && !confirm(msg)) {
                return false;
            }
            form.action = action;
            form.submit();
            return true;
        }

        function optDelete(form) {
            if (Cms.checkeds("ids") == 0) {
                alert("<s:message code='pleaseSelectRecord'/>");
                return false;
            }
            if (!confirmDelete()) {
                return false;
            }
            form.action = 'delete.do';
            form.submit();
            return true;
        }
    </script>
</head>
<body class="skin-blue content-body">
<jsp:include page="/WEB-INF/views/commons/show_message.jsp"/>
<div class="content-header">
    <h1><s:message code="comment.management"/> - <s:message code="list"/>
        <small>(<s:message code="totalElements" arguments="${pagedList.totalElements}"/>)</small>
    </h1>
</div>
<div class="content">
    <div class="box box-primary">
        <div class="box-body table-responsive">
            <form action="comment_Info.do" method="get" class="form-inline ls-search">
                <%--<div class="form-group">--%>
                <%--<label><s:message code="comment.text"/></label>--%>
                <%--<input class="form-control input-sm" type="text" name="search_CONTAIN_text"--%>
                <%--value="${search_CONTAIN_text[0]}"/>--%>
                <%--</div>--%>

                <div class="form-group">
                    <label for="search_CONTAIN_detail.title"><s:message code="info.title"/></label>
                    <input class="form-control input-sm" type="text" id="search_CONTAIN_detail.title"
                           name="search_CONTAIN_detail.title" value="${requestScope['search_CONTAIN_detail.title'][0]}"
                           style="width:150px;"/>
                </div>
                <button class="btn btn-default btn-sm" type="submit"><s:message code="search"/></button>
                <div class="btn-group">
                    <shiro:hasPermission name="core:comment_conf:edit">
                        <button class="btn btn-default" type="button"
                                onclick="location.href='../comment_conf/edit.do?infoid=${infoid}&ftype=${ftype}';">
                            <s:message
                                    code="commentConf.setting"/></button>
                    </shiro:hasPermission>
                </div>
            </form>


            <form method="post">
                <tags:search_params/>

                <table id="pagedTable" class="table table-condensed table-bordered table-hover ls-tb">
                    <thead id="sortHead" pagesort="<c:out value='${page_sort[0]}' />" pagedir="${page_sort_dir[0]}"
                           pageurl="list.do?page_sort={0}&page_sort_dir={1}&${searchstringnosort}">
                    <tr class="ls_table_th">
                        <th width="25"><input type="checkbox" onclick="Cms.check('ids',this.checked);"/></th>
                        <th width="30" class="ls-th-sort"><span class="ls-sort" pagesort="id">ID</span></th>
                        <th class="ls-th-sort"><span class="ls-sort">新闻标题</span></th>
                        <th class="ls-th-sort"><span class="ls-sort">发布时间</span></th>
                        <th class="ls-th-sort"><span class="ls-sort">栏目</span></th>
                        <th class="ls-th-sort"><span class="ls-sort">作者</span></th>
                        <th class="ls-th-sort"><span class="ls-sort">新增评论</span></th>
                        <th class="ls-th-sort"><span class="ls-sort">总评论数</span></th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach var="bean" varStatus="status" items="${listnew}">
                        <tr class="ls_table_th">
                            <td><input type="checkbox" name="ids" value="${bean.id}"/></td>
                            <td><c:out value="${bean.id}"/></td>
                            <td>
                                <div><a href="/cmscp/core/comment/list.do?infoid=${bean.id}&ftype=Info"
                                        title="<c:out value='${bean.title}'/>"><c:out
                                        value="${fnx:substringx_sis(bean.title,30,'...')}"/></a></div>
                            </td>
                            <td>
                                <div><fmt:formatDate value="${bean.publishDate}" pattern="yyyy-MM-dd HH:mm:ss"/></div>
                                <c:if test="${!empty bean.offDate}">
                                    <div><fmt:formatDate value="${bean.offDate}" pattern="yyyy-MM-dd HH:mm:ss"/></div>
                                </c:if>
                            </td>
                            <td>
                                <div>
                                    [<span style='color:#c8103d;'>${bean.model.name}</span>]
                                    &nbsp;[<span style="color:blue;"><c:out value="${bean.node.displayName}"/></span>]
                                    <c:if test="${fn:length(bean.infoAttrs) gt 0}">&nbsp;[<span style="color:#e66100;font-weight:bold;"><c:forEach
                                            var="ia" items="${bean.infoAttrs}" varStatus="status">${ia.attribute.name}
                                        <c:if test="${!status.last}"> </c:if></c:forEach></span>]</c:if>
                                </div>
                            </td>

                            <td>
                                <c:out value="${bean.creator.username}"/>
                            </td>
                            <td>
                                <div><c:out value="${bean.zcont}"/></div>
                            </td>
                            <td>
                                <div><c:out value="${bean.totalCont}"/></div>
                            </td>

                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
                <c:if test="${fn:length(pagedList.content) le 0}">
                    <div class="ls-norecord"><s:message code="recordNotFound"/></div>
                </c:if>
            </form>
            <form action="comment_Info.do" method="get" class="ls-page">
                <tags:search_params excludePage="true"/>
                <%--<f:hidden name="queryNodeId" value="${queryNodeId}"/>--%>
                <%--<f:hidden name="queryNodeType" value="${queryNodeType}"/>--%>
                <%--<f:hidden name="queryInfoPermType" value="${queryInfoPermType}"/>--%>
                <%--<f:hidden id="queryStatus" name="queryStatus" value="${queryStatus}"/>--%>
                <tags:pagination pagedList="${pagedList}"/>
            </form>
        </div>
    </div>
</div>


</body>
</html>